﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection.PortableExecutable;

namespace StoredLisPractice
{
    class Program
    {
        static void Main(string[] args)
        {
            SortedList list = new SortedList();

            SortedList list1 = new SortedList();

            list1.Add(1," 今天是个好日子");
            list1.Add(3," 明天也是个好日子ne");
            list1.Add(5,"  这");
            list1.Add(8, "  钱。");
            list1.Add(6, "  西瓜");
            list1.Add(7, "  多少");
            list1.Add(10, " 这瓜");
            list1.Add(11, " 1000");
            list1.Add(12, " 元。");
            list1.Add(13, " 打个折！");
            list1.Add(14, " 1一块钱卖不卖。");
            list1.Add(15, " 真就一刀999？");

            Console.WriteLine("请输入编号，最好是1到15");
            int id = int.Parse(Console.ReadLine());

            if (id == 1)
            {
                Console.WriteLine(list1[1]);
            }
            else if (id == 3)
            {
                Console.WriteLine(list1[3]);
            }
            else if (id==9)
            {
                Console.WriteLine("此编号不存在");
            }
            else if(id>=5 && id <= 15)
            {
                Console.WriteLine();
                Console.WriteLine("！！！！！这是个笑话喔 ！！！！！" + "\n");

                list1.Remove(1);
                list1.Remove(3);

                list1.Add(16, " \n    -|-是兄弟就来砍我");//临时添加

                foreach (DictionaryEntry item in list1)
                {
                    var k = item.Key;
                    var v = item.Value;

                    Console.WriteLine("{0}{1}", k, v);
                }
            }
            else
            {
                Console.WriteLine("此编号不存在(＾－＾)V");
            }

            Console.WriteLine();
            Console.WriteLine("下面是全部内容\n");
            foreach (DictionaryEntry item in list1)
            {
                var k = item.Key;
                var v = item.Value;

                Console.WriteLine("{0}{1}", k, v);
            }
        }
    }
}
